<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>img-icon</title>
  <style>
    /*
       img是特殊的行内元素(display:inline-block),  可以设置宽高
       默认图片下边有间距   =>  vertical-align:top/bottom/middle 或则 display:block;
       reset.min.css  img{vertical-align: middle;}

       <img>默认是有大小的
       但如果你通过css背景设置图片 默认是没有大小的
    */
    img{
      /* width:30px;
      height:30px; */
      vertical-align: middle; /*基线对齐底下会有空白*/
    }
    .parent{
      background-color: blue;
    }
  </style>
</head>

<body>

<div class="parent">
  <img src="https://img10.360buyimg.com/img/jfs/t1/124600/14/15671/184916/5f8d7112E7f52db74/60ee6ba8e8e5ce3a.gif"  alt="京东" title="鼠标移上">
</div>


<div class="pic">
  <img
    src="https://img20.360buyimg.com/seckillcms/s280x280_jfs/t1/127999/23/14337/160073/5f802231Ed45da485/1c89086cde6b46ed.jpg.webp"
    alt="">
</div>
</body>

</html>
